@extends('admin.layout.layout')

@section('content')
  <script type="text/javascript" charset="utf-8" src="/public/baidu/ueditor.config.js"></script>
    <script type="text/javascript" charset="utf-8" src="/public/baidu/ueditor.all.min.js"> </script>
    <!--建议手动加在语言，避免在ie下有时因为加载语言失败导致编辑器加载失败-->
    <!--这里加载的语言文件会覆盖你在配置项目里添加的语言类型，比如你在配置项目里配置的是英文，这里加载的中文，那最后就是中文-->
    <script type="text/javascript" charset="utf-8" src="/public/baidu/lang/zh-cn/zh-cn.js"></script>

	  <div class="row">
        <div class="col-lg-12">
            <h1 class="page-header">公告修改</h1>
        </div>
        <!-- /.col-lg-12 -->
    </div>
    <div class="row">

@if(session('success'))
	<div class="alert alert-success">
	{{session('success')}}	
	</div>
@endif
    <form action="{{url('/admin/ider/update')}}" method="post">

    <div class="col-sm-6 col-sm-offset-3">
    <div class="form-group">
        <label>标题</label>
        <input class="form-control" name="title" placeholder="" value="{{$ider->title}}">
    </div>
      <div class="form-group">
        <label>公告内容</label>
        <textarea name="content" id="editor" cols="30" rows="10">{{$ider->content}}</textarea>
    </div>
    <script type="text/javascript">

    //实例化编辑器
    //建议使用工厂方法getEditor创建和引用编辑器实例，如果在某个闭包下引用该编辑器，直接调用UE.getEditor('editor')就能拿到相关的实例
    var ue = UE.getEditor('editor');

    </script>
    <div class="form-group">
        <label>作者</label>
        <input class="form-control" name="uname" placeholder="" value="{{$ider->uname}}">
    </div>    
    <div class="form-group">
            <label>状态</label>
            <select class="form-control" name="status">
                <option value="1"@if($ider->status == 1) selected="selected" @endif>未阅读</option>
                <option value="2" @if($ider->status == 2) selected="selected" @endif>阅读</option>
            </select>
     </div>	
     <div class="form-group">
            <label>是否显示</label>
            <select class="form-control" name="show">
                <option value="1"@if($ider->show == 1) selected="selected" @endif>不显示</option>
                <option value="2" @if($ider->show == 2) selected="selected" @endif>显示</option>
            </select>
     </div>  
    <div>
    <button class="btn btn-primary btn-lg btn-block">修改</button>
    </div>
    </div>
    <input type="hidden" name="id" value="{{$ider->id}}">
    <input type="hidden" name="title1" value="{{$ider->title}}">
    <input type="hidden" name="content1" value="{{$ider->content}}">
    <input type="hidden" name="uname1" value="{{$ider->uname}}">
    <input type="hidden" name="status1" value="{{$ider->status}}">
    <input type="hidden" name="show1" value="{{$ider->show}}">
    {{csrf_field()}}    
    </form>

@endsection